<html>
<head><meta charset="utf-8"><title>Fatal error during lowering · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html">Fatal error during lowering</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197801974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197801974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197801974">(May 16 2020 at 15:55)</a>:</h4>
<p>Hello everyone! I have a question about lowering. In order to fix <a href="https://github.com/rust-lang/rust/issues/71104">https://github.com/rust-lang/rust/issues/71104</a> i would like to generate a fatal error for async generator here <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1021">https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1021</a> instead of letting the compilation continue because the produced hir is invalid</p>



<a name="197801979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197801979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197801979">(May 16 2020 at 15:55)</a>:</h4>
<p>Is that a sensible idea?</p>



<a name="197802192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802192">(May 16 2020 at 15:59)</a>:</h4>
<p>If so, how would I do that?</p>



<a name="197802199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802199">(May 16 2020 at 15:59)</a>:</h4>
<p>We're trying to remove fatal errors from the compiler. Maybe we can instead create typecktables for these <code>HirNode::Err</code> that have their <code>tainted_by_errors</code> field set: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckTables.html#structfield.tainted_by_errors">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckTables.html#structfield.tainted_by_errors</a></p>



<a name="197802247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802247">(May 16 2020 at 16:00)</a>:</h4>
<p>I think we should explore some other avenues before introducing a new fatal error</p>



<a name="197802360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802360">(May 16 2020 at 16:03)</a>:</h4>
<p>Ok duly noted. That was just an idea I had. It was to clean up this FIXME i added: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/context.rs#L1117">https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/context.rs#L1117</a></p>



<a name="197802422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802422">(May 16 2020 at 16:04)</a>:</h4>
<p>Maybe one improvements could be to not store <code>NodeId</code> in <code>resolutions.trait_map</code>? Instead storing <code>DefId</code> or <code>NodeId</code>?</p>



<a name="197802449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802449">(May 16 2020 at 16:05)</a>:</h4>
<p>sorry, this is severely out of my mental cache, I need to read up and I don't have that time at the moment. Feel free to ping me on monday if you still don't have an answer</p>



<a name="197802516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197802516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197802516">(May 16 2020 at 16:06)</a>:</h4>
<p>Sure! I'll investigate a bit.</p>



<a name="197805976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Fatal%20error%20during%20lowering/near/197805976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Fatal.20error.20during.20lowering.html#197805976">(May 16 2020 at 17:31)</a>:</h4>
<p>So instead of generating a fatal error, we can just avoid returning a <code>hir::ExprKind::Err</code> and keep going with the lowering: <a href="https://github.com/rust-lang/rust/pull/72275">https://github.com/rust-lang/rust/pull/72275</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>